package com.imooc.sell.service;

import com.imooc.sell.dataobject.ProductCategory;
import com.imooc.sell.dataobject.query.CategoryQuery;
import com.imooc.sell.enums.SortEnum;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.ui.Model;

import java.util.Date;
import java.util.List;

/**
 * 类目
 *
 * @author tianli
 */
public interface CategoryService {

    ProductCategory getOne(Integer id);

    List<ProductCategory> findAll();

    Page<ProductCategory> findAll(Pageable pageable);

    List<ProductCategory> findByCategoryTypeIn(List<Integer> typeList);

    ProductCategory save(ProductCategory productCategory);

    Boolean deletCategory(Integer id);

    /**
     * @param idList 待删除的类目集合
     */
    void deleteByCategoryTypeIn(List<Integer> idList);

    Page<ProductCategory> findCategoryCrCriteria(Integer page, Integer size, CategoryQuery categoryQuery, Integer sortCode);

    Page<ProductCategory> findCategoryByTime(Date createTime, Date endTime, Integer page, Integer size);
}
